package com.srwl.mytx.utils;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class TextUtil {
    public static void createText(String path, String content) {
        File file = new File(path);

        try {
            if (!file.exists()) {
            file.createNewFile();
            }
//            FileOutputStream outputStream = new FileOutputStream(file);
//            PrintWriter writer = new PrintWriter(outputStream);
//            writer.write(content.toCharArray());

            FileWriter fileWriter=new FileWriter(path,false);
            fileWriter.write(content);
            fileWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }


    }
}
